/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jblip.base.resources;

import java.util.Map;

import jblip.resources.UserPicture;

/**
 * @author Krzysztof Sroka
 */
class BaseUserPicture implements UserPicture {
  private static final long serialVersionUID = 1L;

  private final Integer id_;
  private final Map<PictureSize, String> urls_;

  public BaseUserPicture(int id,
          Map<PictureSize, String> urls) {
    this.id_ = id;
    this.urls_ = urls;
  }

  public Integer getID() {
    return this.id_;
  }

  public String getURL() {
    return getURL(PictureSize.DEFAULT);
  }

  public String getURL(PictureSize size) {
    if (size == null) {
      throw new NullPointerException("Null size given");
    }

    return urls_.get(size);
  }
}
